package com.neusoft.bizcore.auth.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.neusoft.bizcore.auth.common.bean.OrgTreeBean;
import com.neusoft.bizcore.auth.common.bean.UserBean;
import com.neusoft.bizcore.auth.dto.AuthOganizationDTO;
import com.neusoft.bizcore.web.support.Searchable;

public interface AuthOganizationService {
    List<AuthOganizationDTO> findAll();

    Page<AuthOganizationDTO> search(Pageable pageable, Searchable searchable);

    AuthOganizationDTO details(final Long id);

    AuthOganizationDTO create(final AuthOganizationDTO dto);

    AuthOganizationDTO update(final Long id, final AuthOganizationDTO dto);

    void delete(final Long id);

    AuthOganizationDTO bind(final Long id, final List<Long> users);

    AuthOganizationDTO addUsers(final Long id, final List<Long> users);

    AuthOganizationDTO removeUsers(final Long id, final List<Long> users);

    /**
     * get organization tree
     *
     * @param root 跟组织代码。null表示从根节点考试
     * @return
     */
    OrgTreeBean orgTree(String root);

    List<OrgTreeBean> currentUserOrganizationTree(UserBean user);

    AuthOganizationDTO details(String code);
}
